<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
      <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <style>
        .row{margin:0;padding: 0}
        .aprovalSystemTable thead th{text-align: center;}
        .agencyM_table tr th {
            text-align: center;
            vertical-align: middle;
            font-size: 14px;
            background: #c8d0d8;
        }
        .agencyM_table tr td {
            text-align: center;
            font-size: 14px;
        }
        .agencyM_table tr td a{margin:0 5px;}
        .colorRed{color:red;}
        .inputText{display: inline-block;width: 20%}
        ul,li{list-style: none;margin:0;padding: 0}
    </style>



</head>

<body class="white-bg" style="padding: 3px;">
<div class="page-heade">
       <h2 class="title_color text-center">批量设置进场条码</h2>
    </div>
    <form action="" class="form-inline" id="form1">
        <table class="table table-bordered">
            <tr>
                <td colspan="1" class="text-right"><label for="">选择产品<span class="redColor">*</span>：</label></td>
                <td colspan="4"><input type="text" class="form-control inputText" placeholder="请输入关键字或空格查询"> <a href="javascript:;">选择</a><a href="javascript:;" style="margin:0 10px">清空</a></td>
            </tr>
            <tr>
                <td colspan="1" class="text-right"><label for="">类型<span class="redColor">*</span>：</label></td>
                <td colspan="4">
                    <div class="form-group">
                        <label>
                            <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
                            进场选中产品
                        </label>
                    </div>
                    <div class="form-group">
                        <label>
                            <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
                            退场选中产品
                        </label>
                    </div>
                </td>
            </tr>
        </table>
        <div class="row white-bg">
            <div class="col-md-12 padding-10 H_title text-left title_color font-bold" style="font-size: 16px;" >
                <div class="col-md-12 ">选择门店信息</div>
            </div>
        </div>
        <table class="table table-bordered white-bg">
            <tr>
                <td colspan="1" class="text-right"><label for="">分区<span class="redColor">*</span>：</label></td>
                <td colspan="4">
                    <select name="" id="" class="form-control select">
                        <option value="0">请选择</option>
                        <option value="1">请选择1</option>
                        <option value="2">请选择2</option>
                    </select>
                    <a href="javascript:;">选择</a><span  class="colorRed">只能选择分区，即选中了分区下的所有网点</span></td>
            </tr>
            <tr>
                <td colspan="1" class="text-right"><label for="">省份：</label></td>
                <td colspan="4"><input type="text" class="form-control inputText" placeholder="请输入关键字或空格查询"> <a href="javascript:;">选择</a><span class="colorRed">只选择省份，即选中了省份下的所有网点</span></td>
            </tr>
            <tr>
                <td colspan="1" class="text-right"><label for="">城市：</label></td>
                <td colspan="4"><input type="text" class="form-control inputText" placeholder="请输入关键字或空格查询"> <a href="javascript:;">选择</a><span class="colorRed">只选择城市，即选中了城市下的所有网点</span></td>
            </tr>
            <tr>
                <td colspan="1" class="text-right"><label for="">经销商：</label></td>
                <td colspan="4"><input type="text" class="form-control inputText" placeholder="请输入关键字或空格查询"> <a href="javascript:;">选择</a><span class="colorRed">只选择经销商，即选中了经销商下的所有网点</span></td>
            </tr>
            <tr>
                <td colspan="1" class="text-right"><label for="">系统：</label></td>
                <td colspan="4"><input type="text" class="form-control inputText" placeholder="请输入关键字或空格查询"> <a href="javascript:;">选择</a><span class="colorRed">只选择系统，即选中了系统下的所有网点</span></td>
            </tr>
            <tr>
                <td colspan="1" class="text-right"><label for="">网点：</label></td>
                <td colspan="4"><input type="text" class="form-control inputText" placeholder="请输入关键字或空格查询"> <a href="javascript:;">选择</a></td>
            </tr>
        </table>
        <div class="col-md-12 text-center" >
            <button class="btn btn-success btn-outline">设置条码</button>
        </div>

    </form>


<!-- 全局js -->
{include file="Public/footer"}
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script>
    /*操作表格复选框*/
    $(document).ready(function(){

        /*批量审批*/
        $(".allApraval").click(function(){
            var $items = $("[name=items]:checkbox")

            if ($items.filter(':checked').length < 1) {
                sweetAlert("", "请选择要审批的系统！", "error");
            } else {
                // $("#alert_addNewZone").show();
                // 要审批的内容
            }
        })
        /*显示明细*/
        $(".showDetail").click(function(){
            layer.open({
                type: 2,
                title: '系统详情',
                shadeClose: true,
                shade: 0.3,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: 'http://localhost/xiaolutong/xiaolutong/system/systemDetail.html'
            })
        });

        /*设置提醒人*/
        $(".setRemindPeople").click(function() {
            layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: 0.3,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '600px'],
                content: 'http://localhost/xiaolutong/xiaolutong/system/setRemindPeople.html'
            })
        });
    });
</script>

<script>
    $(document).ready(function () {
        $(".angency_tableInfo>td>.netNameA").click(function() {
            $(this).parents("tr").next(".this_tableInfo_alert").toggle().siblings(".this_tableInfo_alert").hide();
            $(this).parents("tr").addClass("trBackgroundColor").siblings("tr").removeClass("trBackgroundColor");
        })

        $("#moreQueryIf").click(function(){
            $(this).parent().parent().hide()
            $("#moreTable").show()
            return false
        })
        $("#packQueryIf").click(function(){
            $("#moreTable").hide();
            $("#moreQueryIf").parent().parent().show();
            return false
        })


        $('.del').on('click',function(){
            var arr = []
            $('input[name=items]:checked').each(function(i,o){
                arr.push($(o).val())
            })
            arr = arr.join(',')
            $.post('{:url("batchDelete")}',{ids:arr},function(data){
                if(data.success){
                    location.reload()
                }else{
                    swal(data.msg,'','warning')
                }
            },'json')
        })
        //清除查询条件
        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })
        //增加
        $(".addAprolvalWarn").click(function () {
            layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '600px'],
                content: '{:url("add")}'
            })
            return false
        });
        //回收站
        $("#isdel").click(function () {
            var index = layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '600px'],
                content: '{:url("isdel")}'
            })
            layer.full(index)
            return false
        });

        /*tabel复选框操作*/
        $("#checkAll").click(function() {

            $("[name=items]:checkbox").prop("checked", $(this).prop("checked"));
            if ($("[name=items]:checkbox").prop("checked") != true) {
                // console.log($(this))
                $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#fff")
            } else {
                $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#f8f800")

            }
        })
        $("[name=items]:checkbox").click(function() {
            //定义一个临时变量，避免重复使用同一个选择器选择页面中的元素，提高程序效率
            // console.log(1)
            var $tmp = $("[name=items]:checkbox");
            if ($(this).prop("checked") != true) {
                // console.log($(this))
                $(this).parent().parent().css("backgroundColor", "#fff")
            } else {
                $(this).parent().parent().css("backgroundColor", "#f8f800")

            }
            //用filter()方法筛选出选中的复选框，并直接给CheckedAll赋值
            $("#checkAll").prop('checked', $tmp.length == $tmp.filter(':checked').length);

        })

        //修改
        $(".xiugai").click(function () {
            var link = $(this).attr('href')
            index = layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: link
            })
            layer.full(index)
            return false
        });
        //维护系统
        $(".whSystem").click(function () {
            var link = $(this).attr('href')
            index = layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: link
            })
            layer.full(index)
            return false
        });
        //维护分组货号
        $(".whproductAR").click(function () {
            var link = $(this).attr('href')
            index = layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: link
            })
            layer.full(index)
            return false
        });
        //替换
        $(".tihuan").click(function () {
            var link = $(this).attr('href')
            index = layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: link
            })
            return false
        });
        //追加
        $(".zhuijia").click(function () {
            var link = $(this).attr('href')
            index = layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: link
            })
            return false
        });
        //停止供货
        $('.stopAfford').click(function () {
            var link = $(this).attr('href')
            swal({
                title: "您确定删除吗",
                text: "",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确定",
                closeOnConfirm: false
            }, function (isConfirm) {
                if(isConfirm){
                    $.ajax({
                        'type':'post',
                        'url':link,
                        'dataType':'json',
                        'success':function (data) {
                            if(data.success){
                                location.reload()
                            }else
                                swal(data.msg, "", "error");
                        }
                    })
                }

            });
            return false
        });
    })
</script>
</body>

</html>